<?php

namespace CtyunOss\struct;

use CtyunOss\cors\ArrayObject;

/**
 * Class Error
 * @package CtyunOss\object
 *
 * @author  Violet_Ice紫冰 <violetice@aliyun.com>
 * @create  2020-06-26 13:46:38
 */
class Error extends ArrayObject
{
    /** @var string */
    public $Code;

    /** @var string */
    public $Message;

    /** @var string */
    public $Resource;

    /** @var string */
    public $RequestId;

    public function __toString()
    {
        $json = json_encode([
            'Code'      => $this->Code,
            'Message'   => $this->Message,
            'Resource'  => $this->Resource,
            'RequestId' => $this->RequestId
        ]);
        return '天翼云接口异常：' . $json;
    }
}